package com.gj.feign;


import com.gj.model.TransactionMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * author:guijie
 * date:${date}
 * description:TODO
 */
@FeignClient(value = "transaction-server",path = "/message")
public interface TransactionMessageFeign {

    /**
     * @Description //TODO 发送保存消息
     */
    @RequestMapping("/sendMessage")
    boolean sendMessage(TransactionMessage message);

    /** @Author GuiJie
     * @Description //TODO 确认消息被消费
     */
    @RequestMapping("/confirmCustomerMessage")
    boolean confirmCustomerMessage(@RequestParam("consumerSystem") String consumerSystem, @RequestParam("id") Long id);

    /** @Author GuiJie
     * @Description //TODO 查询最早没有被消费的消息
     * @Date 17:01 2020/10/15
     * @Param
     * @return
     */
    @RequestMapping("/findByWatingMessage")
    List<TransactionMessage> findByWatingMessage();

    /** @Author GuiJie
     * @Description //TODO 确认消息死亡
     */
    @RequestMapping("/confirmDieMessage")
    boolean confirmDieMessage(@RequestParam("id") Long id);

    /** @Author GuiJie
     * @Description //TODO 累加发送次数
     */
    @RequestMapping("/incrSendCount")
    boolean incrSendCount(@RequestParam("id") Long id,@RequestParam("sendDate") String sendDate);

    /** @Author GuiJie
     * @Description //TODO 查询具体状态的消息
     */
    @RequestMapping("/findMessageByStatus")
    List<TransactionMessage> findMessageByStatus(@RequestParam("status") Integer status);

}
